
package com.joysuch.wwyt.bp.enums;

/**
 * 资质证件类型
 */
public enum WorkCertificateTypes {

    TE_ZHONG_ZUO_YE("特种作业操作证", "SFZJLX_TZZYCZZ"),
    ZHU_CE_AN_QUAN_GONG_CHENG_SHI("注册安全工程师执业资格证", "SFZJLX_ZCAQGCSZYZGZ"),
    AN_QUAN_PING_JIA_SHI("安全评价师证", "SFZJLX_AQPJSZ"),
    SHEN_FEN_ZHENG("身份证", "SFZJLX_SFZ"),
    XUE_LI_ZHENG_MING("学历证明", "SFZJLX_XLZM"),
    JIAN_KANG_ZHENG_MING("健康证明", "SFZJLX_JKZM");

    private String code;
    private String name;

    private WorkCertificateTypes(String name, String code) {
        this.name = name;
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public String getCode() {
        return code;
    }

    public static WorkCertificateTypes findByName(String name) {
        WorkCertificateTypes[] values = WorkCertificateTypes.values();
        for (WorkCertificateTypes v : values) {
            if (v.getName().equals(name)) {
                return v;
            }
        }
        return null;
    }

    public static WorkCertificateTypes findByCode(String code) {
        WorkCertificateTypes[] values = WorkCertificateTypes.values();
        for (WorkCertificateTypes v : values) {
            if (v.getCode().equals(code)) {
                return v;
            }
        }
        return null;
    }

    public static String findNameByCode(String code) {
        WorkCertificateTypes[] values = WorkCertificateTypes.values();
        for (WorkCertificateTypes v : values) {
            if (v.getCode().equals(code)) {
                return v.getName();
            }
        }
        return null;
    }
}
